import request from '@/utils/request'

export function queryData(data) {
  return request({
    url: '/admin/role/query',
    method: 'post',
    data
  })
}

export function getRolesByUserId(id) {
  return request({
    url: `/admin/role/user/${id}`,
    method: 'get',
  })
}

export function getDetail(id) {
  return request({
    url: `/admin/role/detail/${id}`,
    method: 'get'
  })
}


export function add(data) {
  return request({
    url: '/admin/role/add',
    method: 'post',
    data
  })
}

export function save(data) {
  return request({
    url: `/admin/role/update`,
    method: 'post',
    data
  })
}

export function deletes(id) {
  return request({
    url: `/admin/role/delete/${id}`,
    method: 'get'
  })
}

export function restore(id) {
  return request({
    url: `/admin/role/restore/${id}`,
    method: 'get'
  })
}

export function bindResource(data) {
  return request({
    url: '/admin/role/bindResource',
    method: 'post',
    data
  })
}
